(function($) {
	$.fn.extend({
		taskbar:function(iconMaxWidth, iconMinWidth) {
			$(this).each(function() {
				$(this).css({
					"width" : "100%",
					"text-align":"center",
					"position" : "absolute",
					"bottom" : 5,
					"z-index" : 9999
				});
				$(this).mouseleave(function() {
					var icons = this.getElementsByTagName("img");
					for(var i=0; i<icons.length; i++) {
						icons[i].width = iconMinWidth;
					}
				});
				this.onmousemove = function(event) {
					var e = event || window.event;
					var icon = null;
					var width = 0;
					var icons = this.getElementsByTagName("img");
					for(var i=0; i<icons.length; i++) {
						icon = icons[i];
						var a = event.clientX - icon.offsetLeft - icon.offsetWidth / 2;
					    var b = event.clientY - icon.offsetTop - this.offsetTop - icon.offsetHeight / 2;
					    var iScale = 1 - Math.sqrt(a * a + b * b) / 300;
						width = iconMaxWidth * iScale;
					    icon.width = width < iconMinWidth ? iconMinWidth : width;
					}
				}
			});
		}
	});
})(jQuery);